================================================================================
                                样例使用说明
                             Sample Description
================================================================================
功能描述：
此样例是对I2S主机与I2S从机以轮询方式进行通信的演示，I2S主机先向I2S从机发送数据
0x1~0x10，I2S从机接收到数据后，再向I2S主机回发数据0x1~0x10，当I2S主机和I2S从机
成功接收数据时，小灯处于常亮状态；否则小灯处于闪烁状态。

Function descriptions:
This sample demonstrates communication between the I2S master and I2S slave 
using polling. The I2S master sends data 0x1 to 0x10 to the I2S slave. The I2S 
slave receives the data and sends back data 0x1 to 0x10 to the I2S master. 
When both the I2S master and I2S slave successfully receive the data, the 
LED will be constantly on. Otherwise, the LED will be blinking.
================================================================================
测试环境：
测试用板：PY32MD530_STK
MDK版本： 5.28

Test environment:
Test board: PY32MD530_STK
MDK Version: 5.28
================================================================================
使用步骤:
1. 准备两块 STK 板，一块作为主机，一块作为从机。
2.打开"#define BOARD_IN_MASTER_MODE"宏定义，编译程序下载到主机。
3.屏蔽"#define BOARD_IN_MASTER_MODE"宏定义，编译程序下载到从机。
4. 连接主机和从机的引脚（箭头指向为信号传输方向）：
   主机 MASTER:        从机 SLAVE:
   WS(PA4)    ----->   WS(PA4)
   CK(PA5)    ----->   CK(PA5)
   SD(PA7)    <---->   SD(PA7)
   GND        <---->   GND
5. 主机和从机上电后，按下主机和从机的复位按键。
6. 先按下从机的用户按键运行从机程序，再按下主机的用户按键运行主机程序。
7. 观察主机和从机的 LED 灯，当主机和从机的 LED 灯由常暗转为常亮状态，则表示主机和从机
   收发数据成功；当主机或从机的 LED 灯处于闪烁状态，则表示主机和从机收发数据失败。

Example execution steps:
1. Prepare two STK boards, one as the master and one as the slave.
2. Open the “#define BOARD_IN_MASTER_MODE” macro definition, compile the program 
   to download to the host.
3. Mask “#define BOARD_IN_MASTER_MODE” macro definition, compile the program to 
   download to the slave.
4. Connect the pins of the master and slave boards (direction indicated by the 
   arrow):
   Master MASTER:      Slave SLAVE:
   WS(PA4)    ----->   WS(PA4)
   CK(PA5)    ----->   CK(PA5)
   SD(PA7)    <---->   SD(PA7)
   GND        <---->   GND
5. Power on the master and slave boards, and press the reset buttons on both.
6. Press the user button on the slave to run the slave program first, then press 
   the user button on the master to run the master program.
7. Observe the LEDs on the master and slave boards. When the LEDs on both the 
   master and slave boards change from dim to constantly on, it indicates that 
   the master and slave have successfully transmitted and received data. If the 
   LEDs on the master or slave are blinking, it indicates a failure in data 
   transmission.
================================================================================
注意事项:
1.必须先按从机复位按键使从机程序先运行，再按主机用户按键开始运行主机程序，否则会
导致主从机通信失败。
2.主机模式可通过程序设置IO控制方式为DMA方式、中断方式和查询方式。
3.NSS引脚只需要在使用NSS硬件方式时连接（本样例使用的是NSS软件方式，无需连接NSS引
脚）。
4.开发板焊接了FLASH器件，使用该样例建议去除R43/R46/R47/R48/R49五个电阻。没有焊接
FLASH器件，无需关注这五个电阻。

Notes:
1.You must press the slave reset button to make the slave program run first, 
and then press the host user button to start running the host program, 
otherwise, the communication between the host and slave will be fail.
2.The host mode can be programmed to set the IO control mode to DMA mode, 
interrupt mode and query mode.
3.NSS pins need to be connected only when using NSS hardware mode (this example 
uses NSS hardware mode,no need to connect NSS pins).
4.The development board is soldered FLASH devices, the use of this sample is
recommended to remove the five resistors R43/R46/R47/R48/R49. No FLASH device is
soldered, no need to pay attention to these five resistors.

================================================================================
